<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
        xmlns:p="http://primefaces.org/ui" 
        xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>Movie Web Service</title>
    </h:head>
        <h:body rendered="#{userService.currentUser.isLoggedIn == false}">
        <h1>Movie Web Service</h1>
        <br/>
        <div>
            <h:form id="form">
                <table>
                    <tr>
                        <td>Login: </td>
                        <td><p:inputText id="login" value="#{userService.currentUser.login}" /></td>
                    </tr>
                    <tr>
                        <td>Password: </td>
                        <td><p:password id="pass" value="#{userService.currentUser.password}"  /></td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <h:messages id="loginpropermess" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p:commandButton id="loginbutton" update="loginpropermess" value="Insecure login" actionListener="#{userService.login()}" />
                        </td>
                        <td>
                            <p:commandButton id="secloginbutton" update="loginpropermess" value="Secure login" actionListener="#{userService.secureLogin()}" />
                        </td>
                    </tr>
                </table>
            </h:form>
        </div>
    </h:body>
    <h:body rendered="#{userService.currentUser.isLoggedIn == true}">
        <h:form>
            <p:commandLink id="redirectlink" action="search.jsf" >Go To Search</p:commandLink>
        </h:form>
    </h:body>
</html>

